<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <ul>
            <!-- <li v-for="n in evenNumbers">{{n}}</li> -->
            <li v-for="n in even(numbers)">{{n}}</li>
        </ul>
    </div>
    <script src="../js/vue.js" charset="utf-8"></script>
    <script type="text/javascript">
        var vm = new Vue({
            el: '#app',
            data: {
                numbers: [1, 2, 3, 4, 5]
            },
            computed: {
                evenNumbers: function () {
                    return this.numbers.filter(function (number) {
                        return number % 2 === 0
                    })
                }
            },
            methods: {
                even: function (numbers) {
                    return numbers.filter(function (number) {
                        return number % 2 === 1
                    })
                }
            }

        })
    </script>
</body>
</html>
